/********************************************************************************
 * <b>Summary: </b>
 * 文件名：RestCodeConstants.java
 * 版本信息：$Rev: 1.0.0 $
 * 日期：2019-09-08
 * Copyright (c) 2005, 2019 www.sunline.cn  
 * 版权所有
 * Licensed under the SUNLINE, Version 20190616 (the "License");
 * [History]
 * Version   Date       Author     				Content
 * -------- --------- ---------- ----------------------------
 * 1.0.0   2019-09-08   蒋万勇(QQ:272389138)    $1.0.0$
 ********************************************************************************/

package com.yishe.api;

/**
 * Created by jiangwy on 2019/8/23.
 * @author 蒋万勇
 * @version  2019/8/23.
 */
public class RestCodeConstants {
    /** 请求成功返回值 - 0  **/
    public static final int RESULT_SUCCESS = 0;
    
    /** 参数校验异常 400-40001 **/
    public static final int EX_PARAM_VALIDATE_CODE = 40001;
    
    /** 用户  401-40101 **/
    public static final int EX_USER_INVALID_CODE = 40101;
    /** 用户  401-40102 **/
    public static final int EX_USER_PASS_INVALID_CODE = 40102;
    /** 用户  401-40103 **/
    public static final int EX_USER_ID_INVALID_CODE = 40103;
    
    /** 客户端 402-40201 **/
    public static final int EX_CLIENT_INVALID_CODE = 40201;
    /** 客户端 402-40202 **/
    public static final int EX_CLIENT_FORBIDDEN_CODE = 40202;
    
    /** Token异常  403-40301 **/
    public static final int TOKEN_FORBIDDEN_CODE = 40301;
    /** Token异常  403-40302 **/
    public static final int TOKEN_ERROR_CODE = 40302;
    
    /** 其他未知异常 500 **/
    public static final int EX_OTHER_CODE = 500;

    public class CommonConstants {
        /** 用户表的主键id**/
        public static final String CONTEXT_KEY_USER_ID    = "currentUserId";
        /** 登录用户名 ***/
        public static final String CONTEXT_KEY_USER_CODE  = "currentUserCode";
        /** 用户中文名称 ***/
        public static final String CONTEXT_KEY_USER_NAME  = "currentUserName";
        /** 用户token信息**/
        public static final String CONTEXT_KEY_USER_TOKEN = "currentUserToken";
        /** 所有请求返回存储的key值 **/
        public static final String CONTEXT_KEY_RESPONSE_BODY = "responseBody";

        /** Redis缓存块命名-登录相关 */
        public static final String REGION_LGOIN = "yishe-login";
        /** Redis缓存块命名-登录相关 */
        public static final String REGION_TOKEN = "yishe-token";
        /** 会话中的用户信息变量名称（只是用户信息）   baseUser **/
        public static final String BASE_USER="baseUser";


    }

}
